#!/bin/bash
#SBATCH -p work
#SBATCH --time=72:00:00
#SBATCH --nodes=4
#SBATCH --ntasks=24
#SBATCH --job-name="test"

N_NODES=4
N_TASKS=24
python write_hostsfile.py -N $N_NODES  -n $N_TASKS
#srun -N 4 -n 4 -p work hostname > hostname.txt

# check if we were able to start writing the conf file
SCOOPHOST_FILE="hostname.txt"
if [ -f $SCOOPHOST_FILE ]; then
    echo "file created..."
else
    echo "$0: can't create $SCOOPHOST_FILE"
    exit 1
fi

python -m scoop --hostfile $SCOOPHOST_FILE -n $N_TASKS scoop_test.py
